<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;

class CreateLogsTable extends Migration {
	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up() {
		Schema::create('logs', function (Blueprint $table) {
			$table->increments('id');
			$table->integer('user_id')->comment('用户ID');
			$table->integer('active')->comment('用户动作 1:收藏, 2:关注, 3:评论, 4:添加, 5:删除');
			$table->integer('class')->comment('操作对象 1:用户, 2:文章, 3:问题, 4:话题, 5:栏目');
			$table->integer('class_id')->comment('操作对象ID');
			$table->timestamps();
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down() {
		Schema::drop('logs');
	}
}
